home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 16
/
Aminet 16 (1996)(GTI - Schatztruhe)[!][Dec 1996].iso
/
Tools
/
Docs
/
DSound
< prev
next >
Wrap
Text File
|
1994-07-18
|
7KB
|
142 lines
DSound V1.50
DSound is Copyright 1991-1994 by Dave Schreiber, All Rights Reserved.
This program is freely distributable, but may not be sold (although a small
fee for copying, media, etc. may be charged).
The files minrexx.o and minrexx.h, included with this distribution,
are exempt from this copyright, as I did not create them.
DSound is utility I wrote to play 8SVX sound samples directly off a
hard drive. While it only takes up a small amount of chip RAM, it can play
samples of unlimited size off a hard drive (it doesn't work to well with
floppies however). Currently, it cannot play compressed sound files.
USING DSOUND
------------
DSound can be used from any form of mass storage (such as hard drives,
flopticals, Syquest drives, etc) except floppy disks. To use DSound, type
"DSound [flags] <filename>" (without the quotes), where <filename> is the
name of the file that you want to play, and [flags] are any of the flags
listed below under "Usage." To stop DSound before a sample is finished
playing, either click on the close gadget in the DSound window (which is
displayed while DSound is playing a sound sample, unless the '-w' flag is
used), press CTRL-C in the Shell window from which DSound was started, type
"break <clinum>", where <clinum> is the number of the Shell window that
DSound is running in, or use DSound's ARexx port (see below).
Usage:
dsound [-l][-r][-2][-f][-m][-o][-w][-n][-t]
[-s<speed>][-v<volume>][-b<bufsize>] file
Where the flags are defined as such:
-l -- Play the sample using the left speaker
-r -- Play the sample using the right speaker
-2 -- Play the sample using both speakers
-f -- Shut off the low-pass filter
-m -- Load the entire sample into memory
-o -- Play the sample continuously (loop)
-w -- Do not open the DSound window
-n -- Do not show the sample name in the window
-t -- Do not show the sample times in the window
-s<speed> -- Play the sample at the given speed (samples/sec)
-v<volume> -- Play the sample at the given volume (0-64)
-b<bufsize> -- Use a buffer of size <bufsize> (default is 30K)
If you don't specify any flags, the defaults are to play the sound out of
the first available speaker, with the filter on, at the speed and volume
specified in the soundfile.
New with version 1.40 of DSound is the ability to halt DSound via an
ARexx command. Specifically, sending a copy of DSound the command "quit"
will cause it to immediate stop playing the sample and exit. DSound's port
is called "DSound.x", where 'x' ranges from 1 to 99; each instance of
DSound will have a different value for 'x'. An ARexx script which
demonstrates this, called "QuitDSound.rx", is included in this
distribution.
WORKBENCH SUPPORT
-----------------
Another feature found first in version 1.40 is Workbench support. If
you make DSound the "default tool" of some sound sample, double clicking on
that sample's icon will cause DSound to play the sample. You can also play
a sample by clicking once on DSound's icon, then (while holding the shift
key down) double-clicking on the sound sample's icon. In either case, when
using DSound from Workbench, you cannot specify the various options given
under "Usage;" you need to run DSound from the CLI in order to adjust how
DSound plays samples. Quitting from DSound, when run from Workbench, is
accomplished either by clicking on DSound's close gadget or using an ARexx
script.
With version 1.50, DSound now supports Workbench tool types. These
are program options entered in the "Tool Types" box, which is part of the
Workbench "Information" window for an icon. One can bring up this window
by clicking on an icon and selecting the "Information..." item from the
"Icons" menus in Workbench. Each tool type is in the form
"<attribute>=<value>", where <attribute> is a particular program attribute
(such as playback volume) and <value> is the value it is to take; both
<attribute> and <value> have to be in all capital letters. DSound will use
tool type information from both its own icon and the icon of the sound
sample to be played; if there is a conflict between tool type information
in the two icons, the information in the sound sample's icon takes
precedence.
A list of tool type attributes follows, along with equivalent command-line
flags and default values used when given attributes are not specified:
SPEAKER -- Determines which speaker the sample plays out of. The <value>
for this attribute can be "LEFT" (left speaker, "-l"), "RIGHT" (right
speaker "-r"), "BOTH" (both speakers, "-2"), or "DONTCARE" (when you don't
care what speaker is used). The default value is "DONTCARE".
SPEED -- The playback speed (equivalent to the "-s" flag). The <value> is
a number less than 28000 which is the speed (in samples/second) at which
the sample should be played. The default speed is specified by
each individual sound sample.
VOLUME -- The playback volume (equivalent to the "-v" flag). <value>
ranges from 0 (silent) to 64 (loudest). The default volume is 64
when not specified by a sound sample.
BUFSIZE -- The amount of memory dedicated to playing samples, in bytes.
Default is 30000.
(The remaining attributes take either "YES" or "NO" as <value>)
PLAYWINDOW -- Determines if the DSound window is opened. Default is "YES".
Equivalent to the "-w" flag.
TITLETIME -- If the DSound window is opened, determines if it should
contain sample times. Default is "YES". Equivalent to the "-t" flag.
TITLENAME -- If the DSound window is opened, determines if it should
contain the name of the sample. Default is "YES". Equivalent to the "-n"
flag.
READALL -- Determines if the entire sample should be loaded into memory at
once, rather than being played off of disk. Defaults to "NO". Equivalent
to the "-m" flag.
FILTER -- Determines if the low-pass filter should enabled during playback.
Defaults to "YES". Equivalent to the "-f" flag.
LOOP -- Determines if the sample should be played continuously (in a loop).
Defaults to "NO". Equivalent to the "-o" flag. WARNING: specifying
"LOOP=YES" and "PLAYWINDOW=NO" will cause DSound to play a sample
continuously without any obvious way of stopping it. Because of this, a
requester will pop up and request confirmation when these two tool types
have been specified so as to ensure that that's really what you want. In
any case, you can use ARexx to stop DSound in this instance.
COMPILING DSOUND
---------------
I've included the source for DSound. To compile (using SAS/C V6) type:
smake
GETTING IN TOUCH WITH THE THE AUTHOR
------------------------------------
If you have any questions, comments, etc. regarding DSound, you can get in
touch with me via Internet e-mail at davids@cse.ucsc.edu .